1. Field of the Invention
The present invention relates to an interpreter, and more specifically, to a Windows™ F-language interpreter.
2. Description of the Prior Art
While executing a high level language, two types of methods are available: a compiler program can convert source code into machine code that can be directly executed, or an interpreter program can translate source code while execution takes place. Six steps are required to execute a program including: lexical analysis, syntactic analysis, semantic analysis, intermediate code generating, optimizing, and object code generating. However, an interpreter does not need to compile the source codes at first, but instead only processes the six steps while executing the source codes. Most test programs are written for F language interpreters in DOS (disk operating system) version and these programs can only be executed in a single task environment.
Please refer to FIG. 1. FIG. 1 is a block diagram illustrating an F language interpreter 10 according to the prior art. The F language interpreter 10 utilizes a parser 12 to interpret a command input by a user in a command line. After the user inputs a command and presses the enter key, the command will be directly executed after parsed by the parser 12 of the F language interpreter 10. When utilizing the F language interpreter 10 to execute a program, the user must input commands one by one in the command line, and press the enter key every time after inputting one command in order to execute the command. The F language interpreter 10 parses and executes the commands input by user one by one by the parser 12, so that user can utilize the F language interpreter 10 to test the software and hardware of a computer system. For example, the F language interpreter 10 can be used to test whether the fan of a central processing unit (CPU) is in operation, whether a memory is correctly accessed, whether a light on a motherboard lights up, or whether a program installed in the computer system is in operation etc. Since DOS is a single task environment where only one command can be executed at a time, the F language interpreter 10 is developed on the basis of DOS and can only simulate a single task environment to execute a test program.
As mentioned above, the DOS F language interpreter 10 simulates a single task testing environment, but most of the modern operating systems apply a multiple task Windows™ system. Under this condition, the single task environment provided by the DOS F language interpreter 10 is unable to fulfill practical requirements. In the single task environment, programs are executed one after another, and unlimitedly utilize system resources, such as CPU, memory and input/output (I/O) etc. Programs may even occupy the computer system from the control side of the operating system. But in the multiple task environment, simultaneous execution of a plurality of programs is allowed so that system resources such as CPU and memory are shared. Therefore resources management is necessary to prevent the simultaneously executed programs from interfering with each other, in order to ensure the programs are fully executed. Moreover, the commands of the F language interpreter 10 are input one by one, which is convenient for users to execute single tests, but ineffective for system integration testing. Additionally, when the F language interpreter 10 interprets a test program, if the test program includes an I/O operation, the user needs to write a far more complicated command sequence in order to execute the I/O operation, which causes further difficulties testing.